<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <book>
            <template v-slot="obj">
                <div>
                    <p>txt:{{obj.txt}}</p>
                    <p>sex:{{obj.sex}}</p>
                </div>
            </template>
        </book>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        let book = {
            template: `
                <div>
                    <p>我是上p</p>
                    <slot :txt="name" :sex="sex" ></slot>                    
                    <p>我是下p</p>
                </div>   
            `,
            data() {
                return {
                    name: "晨光斯基",
                    sex: "男"
                }
            }

        }


        new Vue({
            el: "#app",
            components: {
                book
            }
        });


    </script>
</body>

</html>